package com.oss.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xueqiang.mi
 * @since 2010-7-25
 */
@Controller
public class SystemController extends BaseController {

	@RequestMapping(value = "/system/clearLinks.do", method = RequestMethod.GET)
	public String clearLinks() {
		systemService.clearLinks();
		return "robot/result";
	}

	@RequestMapping(value = "/system/clearPrjs.do", method = RequestMethod.GET)
	public String clearPrjs() {
		systemService.clearPrjs();
		return "robot/result";
	}

	@RequestMapping(value = "/system/clearPrjsByTag.do", method = RequestMethod.GET)
	public String clearPrjsByTag(
			@RequestParam(value = "tagId", required = true) String tagId) {
		systemService.clearPrjsByTag(tagId);
		return "robot/result";
	}

	@RequestMapping(value = "/system/init.do", method = RequestMethod.GET)
	public String init() {
		return "robot/result";
	}

	@RequestMapping(value = "/system/refreshCache.do", method = RequestMethod.GET)
	public String refreshCache() {
		// 刷新缓存
		cacheService.refreshCache();
		return "robot/result";
	}

	@RequestMapping(value = "/system/refreshIndex.do", method = RequestMethod.GET)
	public String refreshIndex() {
		// 刷新首页缓存
		cacheService.refreshIndex();
		return "robot/result";
	}

}
